import type { ConfigProviderThemeVars } from 'wot-design-uni'
import { ref } from 'vue'
import { useProfileStore } from '@/store'

const themeVars = ref<ConfigProviderThemeVars>()

export function useTheme() {
  function toggleTheme() {
    const profileStore = useProfileStore()
    const { operate } = profileStore
    if (operate === 'store') {
      themeVars.value = {
        colorTheme: '#e93b3d',
      }
    }
    if (operate === 'driver') {
      themeVars.value = {
        colorTheme: '#3377fe',
      }
    }
    console.log(themeVars.value)
  }

  return {
    themeVars,
    toggleTheme,
  }
}
